﻿<%@ Page Title="Departure Value-add Products" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DepVA_Products.aspx.cs" Inherits="IFD2.DepVA_Products" %>

<%@ Register Src="~/ctlSeatMatching.ascx" TagPrefix="uc1" TagName="ctlSeatMatching" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <%--<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>--%>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label3" runat="server" Text="Airline:" meta:resourcekey="Airline"></asp:Label>
                <asp:DropDownList ID="lstAirlines" runat="server" CssClass="form-control input-sm" DataSourceID="sqlConsignAirlines" DataTextField="airline" DataValueField="airline" Width="100%"></asp:DropDownList>
            </div>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Flight:" meta:resourcekey="Flight"></asp:Label>
                <asp:TextBox ID="txtFltNo" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="6"></asp:TextBox>
            </div>
            <div class="form-group">
                <asp:Label ID="Label2" runat="server" Text="Date:" meta:resourcekey="Date"></asp:Label>
                <asp:TextBox ID="txtFltDate" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="12"></asp:TextBox>
            </div>
            <div class="form-group">
                <asp:Label ID="Label7" runat="server" Text="Airport:" meta:resourcekey="Airport"></asp:Label>
                <asp:Label ID="lblDcsAirport" runat="server" Font-Bold="true"></asp:Label>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
            <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>

            <asp:SqlDataSource ID="sqlConsignAirlines" runat="server" 
                ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                SelectCommand="bll_office_get_consign_airline_codes" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                <SelectParameters>
                    <asp:SessionParameter Name="office" SessionField="OFFICE" Type="String" />
                    <asp:SessionParameter Name="airport" SessionField="DCS_AIRPORT" Type="String" />
                    <asp:SessionParameter DefaultValue="" Name="user_airline" SessionField="AIRLINE" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" style="min-width:3600px;" class="table-hover"
                            GridLines="None" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:BoundField DataField="ori_airport" HeaderText="ori_airport" SortExpression="ori_airport" meta:resourcekey="ori_airport"/>
                                <asp:BoundField DataField="des_airport" HeaderText="des_airport" SortExpression="des_airport" meta:resourcekey="des_airport" />
                                <asp:BoundField DataField="dep_time" HeaderText="dep_time" SortExpression="dep_time"  meta:resourcekey="dep_time" />
                                <asp:BoundField DataField="arr_time" HeaderText="arr_time" SortExpression="arr_time"  meta:resourcekey="arr_time" />
                                <asp:BoundField DataField="cabin" HeaderText="cabin" SortExpression="cabin" meta:resourcekey="cabin1"/>
                                <asp:BoundField DataField="class" HeaderText="class" SortExpression="class" meta:resourcekey="class1"/>
                                <asp:BoundField DataField="emd_airline" HeaderText="emd_airline" SortExpression="emd_airline" meta:resourcekey="emd_airline" />
                                <asp:BoundField DataField="emd_id" HeaderText="emd_id" SortExpression="emd_id" meta:resourcekey="emd_id"/>
                                <asp:BoundField DataField="emd_name" HeaderText="emd_name" SortExpression="emd_name"  meta:resourcekey="emd_name" />
                                <%--asp:BoundField DataField="service_place" HeaderText="service_place" SortExpression="service_place"  meta:resourcekey="service_place" /--%>
                                <asp:BoundField DataField="quantity" HeaderText="quantity" SortExpression="quantity" meta:resourcekey="quantity1"/>
                                <asp:BoundField DataField="emd_remark" HeaderText="emd_remark" SortExpression="emd_remark"  meta:resourcekey="emd_remark" />
                                <asp:BoundField DataField="associated_seg" HeaderText="associated_seg" SortExpression="associated_seg" meta:resourcekey="associated_seg" />
                                <asp:BoundField DataField="seat_type" HeaderText="seat_type" SortExpression="seat_type" meta:resourcekey="seat_type"/>
                                <asp:BoundField DataField="is_group" HeaderText="is_group" SortExpression="is_group"  meta:resourcekey="is_group"/>
                                <asp:BoundField DataField="bk_id" HeaderText="bk_id" SortExpression="bk_id"  meta:resourcekey="bk_id"/>
                                <asp:BoundField DataField="pax_sn" HeaderText="pax_sn" SortExpression="pax_sn" meta:resourcekey="pax_sn"/>
                                <asp:TemplateField HeaderText="tkt_no" SortExpression="tkt_no" meta:resourcekey="tkt_no">
                                    <ItemTemplate>
                                        <a href='ticket2.aspx?tkt_no=<%# Convert.ToInt64(Eval("bk_id")) * 1000 + Convert.ToInt16(Eval("pax_sn")) %>'><%# Convert.ToInt64(Eval("bk_id")) * 1000 + Convert.ToInt16(Eval("pax_sn"))%></a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Name"  meta:resourcekey="Name1">
                                    <ItemTemplate>
                                        <%#Eval("family_name") + "/" + Eval("name")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Name_En"  meta:resourcekey="Name_En">
                                    <ItemTemplate>
                                        <%#Eval("family_name_en") + "/" + Eval("name_en")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="age_type" HeaderText="age_type" SortExpression="age_type"  meta:resourcekey="age_type" />
                                <asp:CheckBoxField DataField="hold_inf" HeaderText="hold_inf" SortExpression="hold_inf"  Visible="false"/>
                                <asp:CheckBoxField DataField="male" HeaderText="male" SortExpression="male"  meta:resourcekey="male1"/>
                                <asp:BoundField DataField="seat_status" HeaderText="seat_status" SortExpression="seat_status"  meta:resourcekey="seat_status"/>
                                <asp:BoundField DataField="dcs_status" HeaderText="dcs_status" SortExpression="dcs_status" meta:resourcekey="dcs_status" />
                                <asp:TemplateField HeaderText="seat"  meta:resourcekey="seat_no">
                                    <ItemTemplate>
                                        <%#Eval("seat_row") + "" + Eval("seat_col")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="bag_count" HeaderText="bag_count" SortExpression="bag_count"  meta:resourcekey="bag_count" />
                                <asp:BoundField DataField="bag_weight" HeaderText="bag_weight" SortExpression="bag_weight"  meta:resourcekey="bag_weight" />
                                <asp:BoundField DataField="ffp_airline" HeaderText="ffp_airline" SortExpression="ffp_airline" meta:resourcekey="ffp_airline" />
                                <asp:BoundField DataField="ffp_no" HeaderText="ffp_no" SortExpression="ffp_no"  meta:resourcekey="ffp_no" />
                                <asp:BoundField DataField="pax_value" HeaderText="pax_value" SortExpression="pax_value"  meta:resourcekey="pax_value" />
                                <asp:BoundField DataField="nationality" HeaderText="nationality" SortExpression="nationality"  meta:resourcekey="nationality" />
                                <asp:BoundField DataField="id_type" HeaderText="id_type" SortExpression="id_type"  meta:resourcekey="id_type" />
                                <asp:BoundField DataField="id_no" HeaderText="id_no" SortExpression="id_no"  meta:resourcekey="id_no"/>
                                <asp:BoundField DataField="id_expired_date" HeaderText="id_expired_date" SortExpression="id_expired_date"  meta:resourcekey="id_expired_date" DataFormatString="{0:d}" />
                                <asp:BoundField DataField="inf_dob" HeaderText="inf_dob" SortExpression="inf_dob"  meta:resourcekey="inf_dob" DataFormatString="{0:d}" />
                                <asp:CheckBoxField DataField="vip" HeaderText="VIP" SortExpression="vip" />
                                <asp:CheckBoxField DataField="alone_chd" HeaderText="alone_chd" SortExpression="alone_chd" meta:resourcekey="alone_chd" />
                                <asp:BoundField DataField="move_assistant" HeaderText="move_assistant" SortExpression="move_assistant"  meta:resourcekey="move_assistant" />
                                <asp:BoundField DataField="meal" HeaderText="meal" SortExpression="meal"  meta:resourcekey="meal" />
                                <asp:BoundField DataField="tkt_remark" HeaderText="tkt_remark" SortExpression="tkt_remark"  meta:resourcekey="tkt_remark" />
                                <asp:BoundField DataField="email" HeaderText="email" SortExpression="email"  meta:resourcekey="email" />
                                <asp:BoundField DataField="mobile_phone" HeaderText="mobile_phone" SortExpression="mobile_phone"  meta:resourcekey="mobile_phone" />
                                <asp:BoundField DataField="trip_sn" HeaderText="trip_sn" SortExpression="trip_sn"  meta:resourcekey="trip_sn" />
                
                                <asp:CheckBoxField DataField="virtual" HeaderText="virtual" SortExpression="virtual" meta:resourcekey="virtual1"/>
                                <asp:TemplateField HeaderText="flight"  meta:resourcekey="market_flt">
                                    <ItemTemplate>
                                        <%#Eval("airline") + "" + Eval("flt_no")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>

                        <asp:SqlDataSource ID="SqlDataSource1" runat="server"  DataSourceMode="DataReader" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                            SelectCommand="bll_flt_get_emd_list" SelectCommandType="StoredProcedure">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lstAirlines" Name="airline" PropertyName="SelectedValue" Type="String" />
                                <asp:ControlParameter ControlID="txtFltNo" Name="flt_no" PropertyName="Text" Type="String" />
                                <asp:ControlParameter ControlID="txtFltDate" Name="flt_date" PropertyName="Text" Type="DateTime" />
                                <asp:SessionParameter Name="airport" SessionField="DCS_AIRPORT" Type="String" />
                                <asp:SessionParameter Name="office" SessionField="OFFICE" Type="String" />
                                <asp:SessionParameter Name="user_airline" SessionField="AIRLINE" Type="String" />
                                <asp:SessionParameter Name="lang" SessionField="LANG" Type="Int16" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>

                    <div class="well well-sm">
                        <div class="table-responsive">
                            <uc1:ctlSeatMatching runat="server" id="ctlSeatMatching" />
                        </div>
                        <asp:Label ID="Label35" runat="server" meta:resourcekey="ReservingType" Text="Set Seat Type: " Font-Bold="True"></asp:Label>&nbsp;
                        <asp:TextBox ID="txtNewValue" runat="server" MaxLength="2" Width="25px">*</asp:TextBox>
                        &nbsp;<asp:Label ID="Label36" runat="server" meta:resourcekey="legNoControl" Text="[* = No Control]" Font-Italic="true"></asp:Label>
                        <br />
                        <asp:Label ID="Label37" runat="server" Text="Where:" meta:resourcekey="Where"></asp:Label>
                        <br />
                        <asp:TextBox ID="txtWhere" runat="server" Height="69px" MaxLength="150" 
                            TextMode="MultiLine" Width="100%">r.bk_id=9999999 and r.pax_sn=9 and (class=&#39;Y&#39;  or cabin=&#39;F&#39;) 
and fare_code=&#39;XXX&#39; and des_airport=&#39;XXX&#39; and vip=1 and seat_type like &#39;%X%</asp:TextBox>
                        <br />
                        <asp:Label ID="Label18" runat="server" meta:resourcekey="legFields" Font-Italic="true" Text="Avail key words: bk_id,pax_sn,trip_sn,seat_type,class,cabin,emd_airline,emd_id,ori_airport,des_airport,vip,alone_chd,move_assistant,meal"></asp:Label>
                        <br />
                        <asp:Button ID="btnChange" runat="server" meta:resourcekey="Change" onclick="btnChange_Click" Text="Set" CssClass="btn btn-sm btn-default" />
                        <br />
                        <asp:Label ID="lblErrChange" runat="server" CssClass="ifdMessage"></asp:Label>
                    </div>
                </div>
            </div>
        </div>
    </div>

    </div>
    <%--</ContentTemplate></asp:UpdatePanel>--%>
    </form>

    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if ($('#<%=GridView1.ClientID %>').height()>tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>

</asp:Content>
